package com.huo.task.service;

import com.huo.common.enumtype.FileTypeEnum;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.huo.filestransport.service.SftpService;
@DisallowConcurrentExecution
public class CheckFtpFile implements Job {

	private final Logger logger = LoggerFactory.getLogger(getClass());
	@Autowired
	private SftpService sftpService;
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		logger.info("检测FTP服务器文件是否变动的JOB开始");
		sftpService.checkFtpFile(sftpService.makeFtpDirectory(FileTypeEnum.DOWNLOAD));
		logger.info("检测FTP服务器文件是否变动的JOB结束");
	}

}
